package com.dhsc.service.impl.wskh.ewmgl;

import com.dhsc.domain.khzl.common.DictVo;
import com.dhsc.domain.yypt.ResponseObject;
import com.dhsc.exception.MyException;
import com.dhsc.local.dao.wskh.ewmgl.IEwmscDao;
import com.dhsc.service.wskh.ewmgl.IEwmscService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 二维码生成
 * @date 2024/12/2 14:44
 */
@Service
@Slf4j
public class EwmscServiceImpl implements IEwmscService {

    @Autowired
    private IEwmscDao ewmscDao;
    @Override
    public ResponseObject queryYybKhqz(DictVo d) {
        ResponseObject obj = new ResponseObject();
        try {
            List<DictVo> list = ewmscDao.queryYybKhqz(d);
            obj.setData(list);
            obj.setStatus(200);
        }catch (Exception e){
            log.error("查询营业部客户群组出错",e);
            throw new MyException("查询营业部客户群组出错",e);
        }
        return obj;
    }

    @Override
    public ResponseObject queryYybYgxx(DictVo d) {
        ResponseObject obj = new ResponseObject();
        try {
            List<DictVo> list = ewmscDao.queryYybYgxx(d);
            obj.setData(list);
            obj.setStatus(200);
        }catch (Exception e){
            log.error("查询营业部员工信息出错",e);
            throw new MyException("查询营业部员工信息出错",e);
        }
        return obj;
    }

}
